package com.doge.controller.wx;

import com.doge.bean.base.BaseData;
import com.doge.bean.base.BaseRespVo;
import com.doge.bean.pojo.keyword.Keyword;
import com.doge.bean.vo.search.WxSearchHelpVo;
import com.doge.bean.vo.search.WxSearchIndexVo;
import com.doge.service.wx.search.WxSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: doge
 * @description: 搜索功能
 * @author: Mr.Jiang
 * @create: 2021-12-02 14:42
 **/
@RestController
@RequestMapping("wx/search")
public class WxSearchController {
    @Autowired
    WxSearchService wxSearchService;
    @RequestMapping("index")
    public BaseRespVo index(){
        WxSearchIndexVo wxSearchIndexVo=wxSearchService.index();
        return BaseRespVo.ok(wxSearchIndexVo);
    }
    @RequestMapping("helper")
    public BaseRespVo  helper(String keyword){
        WxSearchHelpVo wxSearchHelpVo=wxSearchService.helper(keyword);
        return BaseRespVo.ok(wxSearchHelpVo);
    }
    @RequestMapping("clearhistory")
    public BaseRespVo clearHistory(){
        wxSearchService.clearHistory();
        return BaseRespVo.ok();
    }
}
